﻿using System;

namespace Adaptive.Foundation.Tokenizers
{
    /// <summary>
    /// Provides a custom collection definition for storing <see cref="CharacterTypeEntry"/> types.
    /// </summary>
    public sealed class CharacterTypeEntryCollection : GenericCollectionBase<CharacterTypeEntry>
    {
        /*--------------------------------------------------------------------------------
         * Constructor / Dispose Methods
         *------------------------------------------------------------------------------*/
        #region Constructor / Dispose Methods
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <remarks>
        /// This is the default constructor.
        /// </remarks>
        public CharacterTypeEntryCollection()
            : base()
        {
        }
        #endregion

        /*--------------------------------------------------------------------------------
         * Protected Methods
         *------------------------------------------------------------------------------*/
        #region Protected Methods
        /// <summary>
        /// Provides a the reference key value for adding the item to the internal reference
        /// key list.
        /// </summary>
        /// <param name="newObjectToBeAdded">The object to be added to the collecton.</param>
        /// <returns>
        /// A reference key used to identify the instance.
        /// </returns>
        protected override string GetKeyForObject(CharacterTypeEntry newObjectToBeAdded)
        {
            return newObjectToBeAdded.Name;
        }
        #endregion
    }
}